import React from 'react';
import {BrowserRouter,Link,Route,Switch,Redirect} from 'react-router-dom'
import ProductList from './pages/ProductList'
import ShoppingCar from './pages/ShoppingCar'


class App extends React.Component{
    constructor(props){
        super(props)
    }
  
    render(){
     return (
         <BrowserRouter>
         <div>
            <Link to="/product">跳转产品列表</Link>
            <Link to="/shopCar">跳转购物车</Link>
            <Switch>
              <Redirect from="/" to="/product" exact/>
             <Route path="/product" component={ProductList}/>
             <Route path="/shopCar" component={ShoppingCar}/>
            </Switch>
         </div>  
         </BrowserRouter>
     )
    }
  }
  
  export default App;